package com.czh.controller;

import com.czh.domain.ResponseResult;
import com.czh.domain.entity.User;
import com.czh.domain.vo.UserInfoVo;
import com.czh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * @author caozaihui
 */
@RestController()
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/userInfo")
    public ResponseResult<UserInfoVo> userInfo(){
        return userService.userInfo();
    }
    @PutMapping("/userInfo")
    public ResponseResult<Object> updateUserInfo(@RequestBody User user){
        return userService.updateUserInfo(user);
    }
    @PostMapping("/register")
    public ResponseResult<Object> register(@RequestBody User user){
        return userService.register(user);
    }
}
